<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>登录</title>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <!--weui.min.css-->
    <link rel="stylesheet" href="/static/index/css/page/base.css"/>
    <link rel="stylesheet" href="/static/index/css/page/font.css"/>
    <link rel="stylesheet" type="text/css" href="/static/index/jquery_weui/lib/weui.min.css">
    <!--jquery-weui.min.css-->
    <link rel="stylesheet" type="text/css" href="/static/index/jquery_weui/css/jquery-weui.min.css">
    <link rel="stylesheet" href="/static/index/css/page/login.css" />

</head>
<body>
<div class="pageControl login_deng">
    <div class="pl">
        <img src="/static/index/images/login_bg.jpg" alt="">
        <div class="login_zhu_main">
            <div class="login-img">
                <img src="/static/index/img/logo2.png" alt="" style="width:6rem;height:7.5rem;margin-left:-0.5rem;margin-top:-2rem;">
            </div>
            <div class="login-input">
                <div class="login-label">
                    <label>帐号：</label>
                </div>
                <div class="weui-cell__bd">
                    <input type="text" class="weui-input" id="tel"/>
                </div>
            </div>
            <div class="login-input top-15">
                <div class="login-label">
                    <label>密码：</label>
                </div>
                <div class="weui-cell__bd">
                    <input type="password" class="weui-input" id="pwd"/>
                </div>
            </div>
            <div class="login-flex">
                <a href="/index/login/login_zhu" class="login-btn cl-6666 bg-fff">注册</a>
                <a class="login-btn cl-f bg-ff7" id="login">登录</a>
            </div>
            <div>
                <div class="text-center cl-6666">使用第三方软件登陆</div>
                <div class="login-x"></div>
                <div class="login-flex1">
                    <a id="qqAuthorizationUrl" href="https://graph.qq.com/oauth2.0/authorize?response_type=code&client_id=qqAppId&redirect_uri=http://tour.mgtvshop.com/index/Login/qqLoginCallback" class="qq"><img src="/static/index/img/qq.png" alt=""/></a>
                    <a id="" href="https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxAppId&redirect_uri=http://tour.mgtvshop.com/index/login/getopenid&response_type=code&scope=snsapi_userinfo&state=123#wechat_redirect" class="qq"><img src="/static/index/img/weixin.png" alt=""/></a>
                    <a href="http://tour.mgtvshop.com/index/login/logings"><img src="/static/index/img/weibo.png" alt=""/></a>
                </div>
            </div>
            <div class="login_deng forget_pwd">

                <a href="/index/login/edit_pwd" class="cl-6666">修改密码</a>
                <a href="/index/login/forget_pwd" class="cl-6666 pwd">忘记密码</a>
            </div>
        </div>
    </div>

</div>
<!-- jquery-2.1.4 -->
<script type="text/javascript" src="/static/index/jquery_weui/lib/jquery-2.1.4.js"></script>
<!-- jquery-weui.min.js -->
<script type="text/javascript" src="/static/index/jquery_weui/js/jquery-weui.min.js"></script>
<script>
	$("#login").click(function(){
		tel = $("#tel").val();
		pwd = $("#pwd").val();
		/*申请报名活动的相关参数start*/
		did = {$id};//活动id
		uid = {$uid};//发布者id
		/*申请报名活动的相关参数end*/

		/*好友关注相关参数start*/
		gz_uid = {$gz_uid}
		/*好友关注相关参数end*/

		/*添加好友相关参数start*/
		add_uid = {$add_uid}
		/*添加好友相关参数end*/

		/*未登录状态评论的url  start*/
		pl_url = "{$pl_url}";
		/*未登录状态评论的url  end*/
		$.post(
			"/index/login/login", 
			{ tel: tel,pwd:pwd},
		    function(data){
                obj = jQuery.parseJSON(data);
//		    	console.log(obj);return;
		    	location_url = obj.data;
		    	user_id = obj.user_id
	   			if(obj.code == 1){
	   				alert('登录成功！');
	   				if(location_url == '/index/personal/personal?id='){
	   					//个人信息的跳转
	   					window.location.href=location_url+''+user_id;return;
	   				}
	   				if(location_url == '/index/index/addapply'){
	   					//申请报名活动
	   					window.location.href='/index/index/detail?id='+did+'&uid='+uid;return;
	   				}
	   				if(location_url == '/index/other/other'){
	   					//关注好友
	   					window.location.href=location_url+'?uid='+gz_uid;return;
	   				}
	   				if(location_url == '/index/other/add_friend'){
	   				    uid = add_uid;
	   				    $.cookie('uid',uid);
	   					//添加好友
	   					if(uid)window.location.href='/index/other/other';return;
	   				}
                    if(location_url == '/index/index/send_gift'){
                        //赠送礼物
                        window.location.href='/index/index/detail?id='+did+'&uid='+uid;return;
                    }
	   				window.location.href=location_url
	   			}
	   			if(obj.code == -1){
	   				alert('您输入的密码错误，请重新输入！');
	   			}
	   			if(obj.code == -2){
	   				alert('您输入的账号不存在，请重新输入！');
	   			}
	   			if(obj.code == -3){
	   			    alert('登录成功！检测到您尚未完善信息，请先完善个人信息！');
                    var id = obj.data;
                    window.location.href="/index/personal/photo?id="+id;
                }
		    }
		);
//		window.location.href="/index/login/login?name="+name+"&pwd="+pwd;
	});
</script>
</body>
</html>

